Fix information exposure in OrderInvoiceController and OrderShipmentController#2962
Merged
dpfaffenbauer merged 4 commits into4.1from Jan 30, 2026
Merged
Conversation
…OrderShipmentController Replace exception messages and stack traces in client responses with generic error messages. Detailed error information is now logged server-side using LoggerInterface. Fixes security vulnerability where internal implementation details were exposed to clients. Co-authored-by: dpfaffenbauer <5981845+dpfaffenbauer@users.noreply.github.com>
Address code review feedback to return appropriate error status code instead of HTTP 200 when an error occurs during PDF rendering. Co-authored-by: dpfaffenbauer <5981845+dpfaffenbauer@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix information exposure in error handling
Fix information exposure in OrderInvoiceController and OrderShipmentController
Jan 29, 2026
| ]; | ||
| } catch (\Exception $e) { | ||
| $responseData = '<strong>' . $e->getMessage() . '</strong><br>trace: ' . $e->getTraceAsString(); | ||
| $this->container->get(LoggerInterface::class)->error( |
Address review feedback to remove logging calls and simplify error responses while still preventing information exposure. Co-authored-by: dpfaffenbauer <5981845+dpfaffenbauer@users.noreply.github.com>
|
dpfaffenbauer
approved these changes
Jan 29, 2026
|
I have read the CLA Document and I hereby sign the CLA You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
This PR fixes a security vulnerability (Information Exposure) where internal error messages and stack traces were being returned directly to clients in case of server errors.
Changes Made
OrderInvoiceController.php (renderAction method)
OrderShipmentController.php (renderAction method)
Security Fix
Before: Exception messages and full stack traces were embedded directly into HTML responses sent to clients.
After: Simple generic error message with HTTP 500 status.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.